package com.tcc.etec.mecashow.activity;

import java.util.Random;

import android.app.Activity;
import android.graphics.Point;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.view.Display;
import android.view.View;
import android.widget.Button;
import android.widget.ToggleButton;

import com.tcc.etec.mecashow.R;
import com.tcc.etec.mecashow.listener.ControleTelaPrincipal;
import com.tcc.etec.mecashow.util.Utils;

public class TelaPrincipalActivity extends Activity {
	
	private Button botaoJogar;
	private Button botaoRecordes;
	
	
	private ToggleButton botaoSom;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main); // Define o layout para a activity
        
        // Ouvinte dos cliques dos botoes 
        ControleTelaPrincipal listener = new ControleTelaPrincipal (this);
        
	    botaoJogar = (Button) findViewById(R.id.botaoJogar);
	    botaoJogar.setOnClickListener( listener); // Define o ouvinte do botão jogar
	    
	    botaoRecordes= (Button) findViewById(R.id.botaoRecordes);
	    botaoRecordes.setOnClickListener(listener); // Define o ouvinte do botão record
	    
	  
	    
	  
	    
	    
	    botaoSom = (ToggleButton) findViewById(R.id.botaoSom);
	    botaoSom.setOnCheckedChangeListener(listener); // Define o ouvinte do botão som
    
    }
    
    @SuppressWarnings("deprecation")
    @Override
    protected void onStart() {
    	super.onStart();
		final Display display = getWindowManager().getDefaultDisplay();
        final Point point = new Point();
        display.getSize(point);
        getWindow().getDecorView().getRootView().setBackgroundDrawable(new BitmapDrawable(getResources(), Utils.getBackgroundImage(getResources(), R.drawable.papirus, point.x, point.y)));
    }

  }